<body class="app" data-ad="true">
<?php $CDN= $this->CommonHelper()->imageDomain();?>
<section class="app-content">
	<section class="page page-index noline" data-plugin-type="info_front">

        <div class="top-bar">我的订单<a href="<?php echo $this->url('my', array('action'=>'home'));?>" class="btn-t-back"></a></div>
        <div class="my-order-list">
        	<?php foreach ($this->list as $order) : ?>
            <div class="mo-item">
                <dl>
                    <dt><img src="<?php echo $CDN.$this->escapeHtml($order['org_logo']);?>"></dt>
                    <dd>
                        <div class="t-s-info">
                        
                        	<a href="javascript:;" class="fr btn-yel btn-service">客服</a>
                        	<a href="<?php echo $this->url('organization',
             array('action'=>'index', 'id' => $order['org_id']));?>" class="btn-to-shop">
             					<?php echo $this->escapeHtml($order['org_name']);?>单位</a>
                        </div>
                        <div class="t-s-order">
                            <p><span class="fr t-s-state"><?php echo $this->escapeHtml($order['status_name']);?></span>剩余支付时间：50分钟</p>
                        </div>
 
                        <table class="o-info-list">
                            <tbody>
                            <?php foreach ($order['item_list'] as $item) : ?>
                            <tr>
                                <td class="o-01"><span><?php echo $this->escapeHtml($item['oi_name']);?></span></td>
                                <td class="o-02">¥ <?php echo $this->escapeHtml($item['oi_price']);?></td>
                                <td class="o-03">×<?php echo $this->escapeHtml($item['oi_amount']);?></td>
                            </tr>
                             <?php endforeach; ?>
                            </tbody>

                        </table>
                    </dd>
                </dl>
                <div class="o-ope-line">
                    <p style="text-align: left;"><b>实付：</b><span class="o-s-price">¥ 196.00</span><span class="o-s-total"></span></p>
                    <p class="t-l t-l-no">定单号：<?php echo $this->escapeHtml($order['order_no']);?></p>
                    <p class="t-l">
                    
                    <?php if($order['status'] == 1) { //待付款?>
						<a href="<?php echo $this->url('order', array('action'=>'payment','id'=>$order['order_no']));?>" class="btn-grey">付款</a>
						<?php if($order['status'] == 1) { //待付款?>
							<a href="<?php echo $this->url('myorder', array('action'=>'cancel','id'=>$order['order_no']));?>" class="btn-grey">取消订单</a>
						<?php }?>
                    <?php }elseif($order['status']== 2) { //未发货?>
                    	<?php if($order['cancel_apply'] == 0) { //待付款?>
							<a href="<?php echo $this->url('myorder', array('action'=>'cancel','id'=>$order['order_no']));?>" class="btn-grey">申请取消订单</a>
						<?php }?>	
                    <?php }elseif($order['status']== 3) { //已发货?>
                    	<?php if(empty($order['return_status'])) { //是否已评分?>
                     	<a href="<?php echo $this->url('myorder', array('action'=>'afterSales','id'=>$order['order_no']));?>" class="btn-grey">申请退货</a>
                     	<?php }?>
						<?php if($order['has_score'] != 1) { //是否已评分?>
                     	<a href="<?php echo $this->url('myorder', array('action'=>'score','id'=>$order['order_no']));?>" class="btn-grey">评分</a>
                     	<?php }?>
                    <?php }elseif($order['status']== 4) { //已取消?>
                     	
                    <?php }?>
                    
                    预定时间：<?php echo $this->escapeHtml($order['order_create_time']);?></p>
                </div>
            </div>
             <?php endforeach; ?>
            
        </div>

	</section>

    <!-- 底部menu-->
    <?php echo $this->partial('public/menu.phtml'); ?>
</section>

<div class="bgMask"></div>
<div class="popup popVoucher">
    <p>添加代金券</p>
    <p><input type="text" placeholder="请输入您的代金券码"></p>
    <a href="javascript:;" class="btn-pv-add">添加</a>
</div>

<script type="text/javascript">
$(function () {


   $('.v-ope .btn-v-des').each(function(){
       $(this).click(function(){
           if($(this).hasClass('btn-v-des-up')) {
               $(this).removeClass('btn-v-des-up').next('.v-des').hide();
           }else{
               $(this).addClass('btn-v-des-up').next('.v-des').show();
           }

       })
   })
    $('.btn-t-add').click(function(){
        showVoucher();
    })

    $('.bgMask').click(function(){
        hideVoucher();
    })

    function hideVoucher(){
        $('.bgMask,.popup').hide();
    }
    function showVoucher(){
        $('.bgMask,.popup').show();
    }
});
</script>
